<template>
	<view>
		<uni-popup ref="popup" type="center" animation border-radius="10px">
			<view class="gl-popup-view" style="max-width: 80vw; max-height: 80vh;">
				<view class="gl-popup-title">
					<view class=""> {{title}} </view>
					<uni-icons class="gl-button-mini gl-button-error" type="closeempty" size="18" color="#fff"
						@tap="close"></uni-icons>
				</view>
				<view class="gl-popup-body" style="display: flex;gap: 10px;">
					<imageCardVue :data="curData" :pid="curPid" :gid="curSpu" mode="strict" @reload="eventReload"></imageCardVue>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import imageCardVue from '@/components/sub-product/image-card.vue';
	export default {
		data() {
			return {
				title: '图片集',
				curData: null,
				curPid: null,
				curSpu: null
			}
		},
		components: {
			imageCardVue
		},
		methods: {
			eventReload(){
				this.$emit('reload')
				this.close()
			},
			open(e) {
				this.curData = e.sub_image
				this.curPid = e.pid
				this.curSpu = e.spu
				this.$refs.popup.open()
			},
			close() {
				this.$refs.popup.close()
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>